Identify whether dxl is run for folder or project

I tried with the below code, but even if I run the dxl in project it enters folder option:
if( (!null (current Folder)) && (!project(name(current Folder))) )
{
print "Dxl run in folder"
}
else if(project(name(current Folder)))
{
print "Dxl run in project"
}

Pls let me know if there is any other alternative to find whether dxl is run for project or folder.
DXLScripter - Fri Sep 21 03:45:51 EDT 2012

Re: Identify whether dxl is run for folder or project
adevicq - Fri Sep 21 04:05:22 EDT 2012

Hi,

Try this in the DXL interaction window:

Folder f = current
print type(f)

 


A project is a folder. This works if the current folder is a folder or a project.
Regards,
alain

 

Re: Identify whether dxl is run for folder or project
DXLScripter - Fri Sep 21 04:25:39 EDT 2012

Thank you so much.
I modified my code as below:

if( (!null (current Folder)) && ("Folder" == type(current Folder)) )
{
print "Dxl run in folder"
}
else if( (!null (current Project)) && ("Project" == type(current Folder)) )
{
print "Dxl run in project"
}

Re: Identify whether dxl is run for folder or project
adevicq - Fri Sep 21 04:33:11 EDT 2012

DXLScripter - Fri Sep 21 04:25:39 EDT 2012
Thank you so much.
I modified my code as below:

if( (!null (current Folder)) && ("Folder" == type(current Folder)) )
{
print "Dxl run in folder"
}
else if( (!null (current Project)) && ("Project" == type(current Folder)) )
{
print "Dxl run in project"
}

Or

Folder f = current
if (f != null) {
 
}

Re: Identify whether dxl is run for folder or project
adevicq - Fri Sep 21 04:34:58 EDT 2012

adevicq - Fri Sep 21 04:33:11 EDT 2012

Or

Folder f = current
if (f != null) {
 
}

Or

Folder f = current
if (f != null) {
  if (type(f) == "folder") {
  ...
  }
  else if (type(f) == "Project) {
  ..
  }
}